import request from '@/utils/request'

// 办公用品维保申请 VO
export interface OfficeRequisitionVO {
  id: number // 办公用品领用id
  title: string // 标题
  specify: string // 具体情况
  userName: string // 申请人
  userId: number|string // 申请人id
  userDept: string // 申请部门
  userDeptId: number // 申请部门id
  applicationTime: string|number // 申请时间
  equipmentNun: string // 设备数
  maintenanceType: string // 维修类型 1.维修 2.更换 3.报废
  url: string // 附件
  departmentLeader: string // 部门主管领导
  sofficeKeeper: string // 办公室内勤人员
  officeManager: string // 办公室采购员
  officeLeader: string // 办公室主任
  remark: string // 备注
  processInstanceId: string // 流程编号
  officeRequisitionDetailss?: Array<string>
  startUserSelectAssignees:any
  status: any // 流程状态
  isApproved:any;
  [key: string]: any;
}

// 办公用品领用单 API
export const OfficeequipmentrepairApi = {

  // 获得办公用品维保申请分页
  getOfficeequipmentrepairPage: async (params: any) => {
    return await request.get({ url: `/bpm/office-maintenance/page`, params })
  },

  // 创建办公用品维保申请
  createOfficeequipmentrepair: async (data: OfficeRequisitionVO) => {
    return await request.post({ url: `/bpm/office-maintenance/create`, data })
  },

  // 修改办公用品维保申请
  updateOfficeequipmentrepair: async (data: OfficeRequisitionVO) => {
    return await request.put({ url: `/bpm/office-maintenance/update`, data })
  },

  // 删除办公用品维保申请
  deleteOfficeequipmentrepair: async (id: number) => {
    return await request.delete({ url: `/bpm/office-maintenance/delete?id=` + id })
  },

  // 获得办公用品维保申请详情
  getOfficeequipmentrepair: async (id: number) => {
    return await request.get({ url: `/bpm/office-maintenance/get?id=` + id })
  },

  // 导出办公用品维保申请 Excel
  exportOfficeequipmentrepair: async (params:any) => {
    return await request.download({ url: `/bpm/office-maintenance/export-excel`, params })
  },

}
